import React from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter,Route} from "react-router-dom";
import Routes from "../Routes";
import {Provider} from 'react-redux';
import getStore from "../store";
import {renderRoutes} from "react-router-config";

// ReactDOM.render(<Home/>, document.getElementById('root'));
//↑ 会报一个警告: react-dom.development.js:88 Warning: render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup.

const store = getStore();

const App = () => {
  return (
    <Provider store={store}>
      <BrowserRouter>
        {renderRoutes(Routes)}
      </BrowserRouter>
    </Provider>
  )
};

ReactDOM.hydrate(<App/>, document.getElementById('root'));
